/*
package com.jml.整合springboot.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.FanoutExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class TopicConfig {
	// 邮件队列
	private String TOPIC_EMAIL_QUEUE = "topic_eamil_queue";
	// 短信队列
	private String TOPIC_SMS_QUEUE = "topic_sms_queue";
	// 交换机
	private String EXCHANGE_NAME = "topicExchange";

	// 1.定义队列邮件
	@Bean
	public Queue topicEamilQueue() {
		return new Queue(TOPIC_EMAIL_QUEUE);
	}

	@Bean
	public Queue topicSmsQueue() {
		return new Queue(TOPIC_SMS_QUEUE);
	}

	// 2.定义Topic交换机
	@Bean
	public TopicExchange topicExchange(){
		return new TopicExchange(EXCHANGE_NAME);
	}


	// 3.队列与交换机绑定邮件队列
	@Bean
	Binding bindingExchangeEamil(TopicExchange topicExchange) {
		return BindingBuilder.bind(topicEamilQueue()).to(topicExchange()).with("topic.t.o");
	}

	// 4.队列与交换机绑定短信队列
	@Bean
	Binding bindingExchangeSms(Queue topicSmsQueue, FanoutExchange topicExchange) {
		return BindingBuilder.bind(topicSmsQueue).to(topicExchange);
	}
}

*/
